home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
tex
/
cleans11.zip
/
CLEANSE.DOC
< prev
next >
Wrap
Text File
|
1988-06-23
|
6KB
|
172 lines
CLEANSE: Clean any text file to make an ASCII file, Version 1.1
(c) 1987,'88
W. Parke
1812 S St. NW
Washington,D.C. 20009
Description: The program CLEANSE is a utility for operation
as a command under the MS-DOS operating system,
version 2 or higher. It is designed to remove
extraneous characters from text files and make
them into ordinary ASCII text files. Any non-
standard end-of-line terminators will be
replaced by a proper carriage-return-linefeed
combination. The cleansed file can then be used
by standard ASCII text editors or printed on
standard line printers. Several optional
switches are available to remove extra spaces,
remove line indentations, preserve tabs, or to
preserve form feeds.
Distribution: CLEANSE may be freely distributed provided
that it remains unaltered and is not packaged
with or in promotion of any commercial product
or venture, except by direct agreement with the
author.
Syntax: CLEANSE file1 file2 [/switch]
File1 is any text file which may have improper
end-of-line termination or extraneous control
codes. CLEANSE creates file2 to contain the
processed text. If file2 already exists, the
user will be asked if file2 is to be
overwritten. File2 cannot have the same name as
file1. A DOS path name may be used to preface
either file name. The following command line
switches are allowed:
/ri = Remove Indentation of lines
/rs = Remove extra Space between words
/st = Save Tab characters
/sf = Save Form Feeds
Operation:
CLEANSE removes any extraneous control codes, makes
end-of-line termination in ASCII format, removes
trailling blanks, drops any parity bits (bit 7) on
characters, and removes the deletes.
The /ri Switch:
By default, indented lines retain indentation. With
the /ri switch in force, lines indented with spaces
or tabs will have their indentation removed.
The /rs Switch:
ASCII files are often created by word processors
which add extra space between words in order to
justify the right margin of text. The /rs switch
option will let CLEANSE remove extra spaces in the
text. Two spaces will be saved between sentences
even with the /rs switch in force.
The /st Switch:
CLEANSE will expand tab characters with spaces
characters, taking the tab stops to be in columns
1,9,17,25,33,41, etc. (i.e. separated by 8 columns).
These positions are the assumed tab stops for an
ASCII file in MS-DOS. With the /st switch, all tab
characters will be saved.
The /sf Switch:
CLEANSE will normally remove all control codes in a
text file except carriage returns and linefeeds.
Form feeds are converted into a pair of carriage-
return-linefeeds. However, with the /sf switch on
the command line, the form feed character (0C in
hex) will be saved in the converted ASCII file.
This may be desirable if the converted file is to be
sent to a printer.
Example commands:
CLEANSE
will show a short help screen to remind the user of
the command syntax.
CLEANSE FOO.TXT FOO.DOC
converts the text file called FOO.TXT into the ASCII
file called FOO.DOC.
CLEANSE FOO.TXT \DOCS\FOO.DOC /RS/RI
converts the text file FOO.TXT into FOO.DOC in the
subdirectory DOCS. Extra spaces in the text and
line indentation are removed.
Error Messages:
Two different files must be specified.
CLEANSE found that file1=file2. The second file
and path name must be distinct from the first.
Invalid switch given.
A command line switch begins with the slash
character (/) followed by a two character switch
indicator. Several switches are allowed, and
they may appear anywhere on the command line
after the CLEANSE command itself. Space
separators are not required.
File not found.
The first file name or path is invalid.
No conversion done.
A request to overwrite an already existing
second file was denied by the user.
Not enough memory.
In order to operate quickly, CLEANSE creates two
buffers for the input and output files. The
input buffer is the smaller of 64K or the input
file size. The output buffer is always 64K. As
much as 132K may be required.
Error opening file.
The input file cannot be read, or the output
file already exists and cannot be overwritten.
Error creating file.
The output file may already exist as a hidden
file.
Error reading file.
CLEANSE could not read a portion of the input
file.
Error writing converted file.
CLEANSE could not write a portion of the output
file. There may be insufficient disk space.
File to receive conversion already exists.
If the output file already exists, you will be
asked if you wish to overwrite it. The answer
must be Yes or No (y,n,Y,N accepted).
Version History:
July, 1987 Version 1.0
June, 1988 Version 1.1 Added removal of trailing blanks
on each line.